package com.example.reagent_management.ui.home.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.reagent_management.R;
import com.example.reagent_management.ui.home.pojo.PositionCounts;

import java.util.List;

public class HomeCountsAdapter extends BaseQuickAdapter<PositionCounts,BaseViewHolder> {

    //初始化布局 设置初始化数据
    public HomeCountsAdapter() {
        super(R.layout.item_position);
    }

    //不用dataBinding绑定的话使用 holder绑定
    @Override
    protected void convert(@NonNull BaseViewHolder helper, PositionCounts position) {
        helper.setText(R.id.position,String.valueOf(position.getPosition()))
                .setText(R.id.counts,String.valueOf(position.getCounts()));
//        Glide.with(getContext())
//                .load(R.drawable.reagent)
//                .transition(DrawableTransitionOptions.withCrossFade(500))
//                .into((ImageView) helper.getView(R.id.reagent_view));
    }
}
